package com.habdqn.studentmanager.bean;

import java.util.Date;
import java.util.List;

/**
 * @author Fan
 * 
 * 2017年7月5日
 * 
 */
public class StudentAttRecord extends Bean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * 学生信息
	 */
	private Student student;
	
	/**
	 * 要查询的考勤日期
	 */
	private Date attDate;
	
	/**
	 * 考勤记录 
	 */
	private List<AttendanceRecord> records;

	/**
	 * 上午状态 
	 * > 0 表示签到成功
	 * = 0 表示没有签到 
	 * < 0 表示迟到
	 */
	private Integer amState;
	
	/**
	 * 下午状态 
	 * > 0 表示 早退
	 * = 0 表示没有签到
	 * < 0 表示签到成功
	 */
	private Integer pmState;
	
	/**
	 * @return the student
	 */
	public Student getStudent() {
		return student;
	}

	/**
	 * @param student the student to set
	 */
	public void setStudent(Student student) {
		this.student = student;
	}

	/**
	 * @return the attDate
	 */
	public Date getAttDate() {
		return attDate;
	}


	/**
	 * @return the records
	 */
	public List<AttendanceRecord> getRecords() {
		return records;
	}

	/**
	 * @param records the records to set
	 */
	public void setRecords(List<AttendanceRecord> records) {
		this.records = records;
	}

	/**
	 * 上午状态 
	 * > 0 表示签到成功
	 * = 0 表示没有签到 
	 * < 0 表示迟到
	 */
	public Integer getAmState() {
		return amState;
	}

	/**
	 * 下午状态 
	 * > 0 表示 早退
	 * = 0 表示没有签到
	 * < 0 表示签到成功
	 */
	public Integer getPmState() {
		return pmState;
	}

	/**
	 * @param amState the amState to set
	 */
	public void setAmState(Integer amState) {
		this.amState = amState;
	}

	/**
	 * @param pmState the pmState to set
	 */
	public void setPmState(Integer pmState) {
		this.pmState = pmState;
	}

	/**
	 * @return the amStateStr
	 */
	public String getAmStateStr() {
		if (amState  > 0) {
			return "已签到";
		}
		
		if (amState == 0) {
			return "未签到";
		}
		
		return "迟到";
	}

	/**
	 * @return the pmStateStr
	 */
	public String getPmStateStr() {
		
		if (pmState > 0) {
			return "早退";
		}
		
		if (pmState == 0) {
			return "未签到";
		}
		
		return "已签到";
	}

	/**
	 * @param attDate the attDate to set
	 */
	public void setAttDate(Date attDate) {
		this.attDate = attDate;
	}
}
